package io;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * @User: vitobo
 * @Date: 2024-08-13
 * @Description: 写操作(字符流)
 *
 */
public class IODemo9 {
    public static void main(String[] args) {
        try(Writer writer = new FileWriter("f:/test.txt")){
            writer.write("welcome to xian");
            // 手动刷新缓冲区
            writer.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
